from flask import Flask, Blueprint, request
from flask_cors import CORS
from web import chat,  web2,   knowledgebase
from configuration.database import db
import configuration.config
# 用当前脚本名称实例化Flask对象，方便flask从该脚本文件中获取需要的内容
app = Flask(__name__)

app.config.from_object(configuration.config)
db.init_app(app)

CORS(app)

# 添加蓝图
app.register_blueprint(chat.chat)
app.register_blueprint(web2.web2)
app.register_blueprint(knowledgebase.knowledgebase)

# 启动
app.run(host="0.0.0.0")